package com.quecomohoy.datos;

import java.sql.*;
import javax.swing.JOptionPane;

public class datConexion 
{
	public static Connection getConexion() throws Exception
	{
		Connection cn=null;
		
		try
		{
			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
			cn=DriverManager.getConnection("jdbc:sqlserver://localhost:1433; "+"databaseName=BDquecomohoy","sa","12345678");
		}
		
		catch(Exception e)
		{
			System.out.print("Error al conectar a la BD");
			JOptionPane.showMessageDialog(null, e, "datConexion",JOptionPane.ERROR_MESSAGE);
		}
		return cn;
	}
}